﻿/*-----------------------------------------------
// File: FirstUltimateEndState.cs
// Description: 
// Author: Shaobing	492057342@qq.com
-----------------------------------------------*/
using UnityEngine;
using System.Collections;

namespace Battle.View
{
    public class FirstUltimateEndState : UltimateEndState
    {
        public BattleViewFirstCtrl firstViewCtrl {
            get { return battleRoundCtrl.viewCtrl as BattleViewFirstCtrl; }
        }
        public FirstUltimateEndState(BattleRoundState state, FirstBattleRoundCtrl ctrl) : base(state, ctrl) { }

        public override void Leave()
        {
            base.Leave();
            if (firstViewCtrl.curRunningCamp == BattleCamp.Attacker)
            {
                BattleManager.Instance.battleEngine.compute.data.attacker.angerNum = BattleManager.Instance.battleEngine.compute.data.attacker.maxAngerNum;
                BattleViewCtrl.GetInstance().SetAngerNum(BattleViewCtrl.GetInstance().GetAngerMax(BattleCamp.Attacker), BattleCamp.Attacker);
            }

            if (firstViewCtrl.curGuideStep == BattleViewFirstCtrl.FirstBattleGuideStep.UltimateSkillNeedFirstCast)
            {
                if (FirstCheckPointUtil.curUltiIndex == 0)
                {
                    FirstCheckPointUtil.CheckPoint(EnterGameCheckPointEnum.GuideUltimateSkill1);
                    FirstCheckPointUtil.curUltiIndex++;
                }
                else if (FirstCheckPointUtil.curUltiIndex == 1)
                {
                    FirstCheckPointUtil.CheckPoint(EnterGameCheckPointEnum.GuideUltimateSkill2);
                    FirstCheckPointUtil.curUltiIndex++;
                }
                else if(FirstCheckPointUtil.curUltiIndex == 2)
                {
                    FirstCheckPointUtil.CheckPoint(EnterGameCheckPointEnum.GuideUltimateSkill3);
                    FirstCheckPointUtil.curUltiIndex++;
                }

            }
            
        }
    }
}